<?php
/**
 * (exporter)
 */
namespace App\Exporter\Products;

use App\Models\Product\ProductClassify;
use Encore\Admin\Grid\Exporters\ExcelExporter;
use Maatwebsite\Excel\Concerns\WithMapping;
class ProductClassifyExporter extends ExcelExporter implements WithMapping
{
    protected $fileName = '品类.xlsx';

    protected $headings = ['ID','季节性','品类','ModelNo','启用','创建时间'];

    public function map($model) : array
    {
        return [
            $model->id,
            ProductClassify::$_season[$model->season],
            $model->title,
            $model->model_no,
            ProductClassify::$_status[$model->status],
            $model->created_at,
        ];
    }

}
